/*
 * IGGoalsDistributor.java
 * Created on 16 nov. 2008
 *
 * Glacéo Internet Platform
 * http://sourceforge.net/projects/chm/
 *
 * Copyright (c) 2005-2009, Jens and Jan Janke (VirtualHockey Project)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hockeo.vhbase.data.impl.goals;


import java.math.BigDecimal;

import com.hockeo.vhbase.data.dao.club.GClub;
import com.hockeo.vhbase.data.dao.contest.GContestElement;
import com.hockeo.vhbase.error.GNotImplementedException;

/**
 * Interface to be implemented by goal distributors. Goal distributors determine how many
 * goals are initially given to a team in a certain competition.
 *
 * @version $Id$
 * @author jjanke
 */
public interface IGGoalsDistributor
{
  /**
   * Initializes the goals distributor for the given contest element.
   *
   * @param element the contest element for which goals should be distributed
   */
  public void initialize( GContestElement element );

  /**
   * Returns the amount of goals that should be allocated for a team with the given
   * seeding. Implementations are not required to provide implementations for both methods
   * {@link #getGoals(int)} and {@link #getGoals(GClub)}. However, at least one method
   * must work. The other can throw a {@link GNotImplementedException}.
   *
   * @param nSeeding the seeding of the club for which to return the amount of desired
   *          goals. The seeding always starts at 1 and goes until N (number of teams in
   *          the same contest element).
   * @return the amount of goals foreseen for the given seeding
   */
  public BigDecimal getGoals( int nSeeding );

  /**
   * Returns the amount of goals that should be allocated to the given team.
   * Implementations are not required to provide implementations for both methods
   * {@link #getGoals(int)} and {@link #getGoals(GClub)}. However, at least one method
   * must work. The other can throw a {@link GNotImplementedException}.
   *
   * @param club the club for which the goals should be allocated.
   * @return the amount of goals foreseen for the given club
   */
  public BigDecimal getGoals( GClub club );
}
